using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Rodunu.Utilities.JSON.Converters
{
	public class HtmlColorConverter : JsonConverter
	{
		public override void WriteJson(JsonWriter writer, object value)
		{
			writer.WriteValue(ColorTranslator.ToHtml((Color) value));
		}

		public override bool CanConvert(Type valueType)
		{
			return typeof(Color).IsAssignableFrom(valueType);
		}
	}
}
